#include <iostream>
#include <unistd.h>
#include <signal.h>

using namespace std;


void myhandler(int signno)
{
    cout<<"I receive a "<<signno<<"signal"<<endl;
}

int main()
{
    signal(5,myhandler);
    int n = 0;
    while(true)
    {
        cout<<"crazy process"<<endl;
        n++;
        if(n == 5)
        {
            raise(5);
        }
        if(n == 10)
        {
            abort();
        }
        sleep(1);
    }
    return 0;
}